package com.zhh.dao;

import com.zhh.pojo.TbOrderShipping;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface OrderShippingDao extends JpaRepository<TbOrderShipping,String> {

    TbOrderShipping findByOrderId(@Param("orderId") String orderId);

    @Modifying
    @Query("update TbOrderShipping s set s.deliveryId = :deliveryId where s.orderId = :orderId")
    int updateDelivery(@Param("orderId") String orderId,@Param("deliveryId") Long deliveryId);
}
